<template>
	<view class="mainpadding">
		<u-modal :show="show" cancelColor="#555" confirmColor="#F13A3A" :showCancelButton="true" :title="title"
			@cancel="show=false" @confirm="confirm"></u-modal>
		<view class="flexbetween mainpadding radius tybjs" @click="jumper('/pages_mypage/xiugaimm')">
			<view class="ershiba xiaobai fonweight">修改密码</view>
			<u-icon name="arrow-right" color="#C8C8C8"></u-icon>
		</view>
		<!-- <view class="flexbetween mainpadding radius tybjs margin_top" @click="jumper('/pages_mypage/genghuansjh')">
			<view class="ershiba xiaobai fonweight">手机号码</view>
			<u-icon name="arrow-right" color="#C8C8C8"></u-icon>
		</view> -->
		<view class="flexbetween mainpadding radius tybjs margin_top" @click="jumper('/pages_mypage/xiugaizfb')">
			<view class="ershiba xiaobai fonweight">修改银行卡信息</view>
			<u-icon name="arrow-right" color="#C8C8C8"></u-icon>
		</view>
		<view class="gudingdb mainpadding" @click="show = true">
			<view class="bigbtn">退出登录</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	import WebSocket from '@/static/websocket.js' //websocket封装
	export default {
		data() {
			return {
				show: false,
				title: '确定要退出当前账户么？',
				websocket:null,
			}
		},
		methods: {
			confirm() {
				this.show = false;
				// 将存储的数据改为空达到退出登录的效果
				uni.setStorageSync('token', "");
				uni.setStorageSync('user_id', "");
				httpRequest.toast("退出登录成功")
				this.websocket = new WebSocket("wss://kuaixunapp.yuntaiqikeji.com:8282");
				this.websocket.close()
				setTimeout(() => {
					uni.redirectTo({
						url: '/pages/login/login'
					})
				}, 1000)
			},
			jumper(url) {
				uni.navigateTo({
					url: url
				})
			},
		}
	}
</script>

<style>

</style>
